Reputation: 11272
How do I split a line of text in bash using SOH delimiter?
Upvotes: 1
Views: 7446
Reputation: 342353
you can use the octal value of SOH as a delimiter using awk.
$ awk -F"\001" '{print $1}' file
Upvotes: 3
Reputation: 3707
You can set the IFS variable to change the delimiter between words. (Don't forget to save the old value so you can restore it when you're done.)
Based on a quick google I assume "SOH delimiter" is the character with code 1, so you need to get that odd character into IFS:
IFS=`echo -e '\01'`
If that's not enough, you probably need to expand on "split a line of text". What do you want to split it into?
Upvotes: 0