FG

What is the ^I character and how do I find it with sed?

Fresh3 days ago
Mar 15, 202619501 views
Confidence Score0%
0%

Problem

I usually import data from csv files to MySQL, but my data provider leaves NULL entries as "", so I need to replace "" with "\N". This is easy enough with a script like However, I have a csv file with commas, so the import fails. I got the file as "tab delimited" and tried But it still fails (as fa…

Error Output

for csvfile in *.csv
do
    sed -i -e 's/^,/\\N,/' -e 's/,$/,\\N/' -e 's/,,/,\\N,/g' -e 's/,,/,\\N,/g' $csvfile
done

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: What is the ^I character and how do I find it with sed?

Low Risk

^ is normally shorthand for Ctrl and Ctrl-I is the same as Tab

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment