Search Results

Search: Posts Made By: var285
15,713
Posted By var285
ed can save the day! :) printf %s\\n...
ed can save the day! :)

printf %s\\n '1,$s/^[^|]*|//' w q | ed -s file
or using a heredoc
ed -s file <<'EOED'
1,$s/^[^|]*|//
w
q
EOED

---------- Post updated at 05:25 PM ----------...
15,713
Posted By var285
Thank you Shell_Life and Mirni.. Mirni For...
Thank you Shell_Life and Mirni..
Mirni
For sed i am getting error when i use -i option
> sed -i 's/^[^|]*|//' FINAL.output
sed: illegal option -- i
Usage: sed [-n] [-e script] [-f source_file]...
15,713
Posted By var285
sed command to remove the first field from a '|' delimited file
Hi
I have a file with fields delimited by |. I need to remove the first field from the file. I tried cut but it just extracts that field.

sample.output
abc|100|name1
cde|200|name2...
Showing results 1 to 3 of 3

 
All times are GMT -4. The time now is 07:29 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy