0

I have a CSV file which contains 65000 lines (size approximately 28 MB). On each of the lines they have a path in the beginning in the format of: c:\abc\bcd\def\123\456.

Now let's say the path c:\abc\bcd\ is common in all the lines and the rest of the content is different. I have to remove the common part from all the lines. In this case, c:\abc\bcd\.

How can I remove this using a shell script?

2
  • 1
    Can you not simply replace the common part "c:\abc\bcd\" with ""? Commented Apr 15, 2015 at 8:17
  • Any text editor will be able to do the search & replace operation that duDE suggests, so do you really need a shell script?
    – Karan
    Commented Apr 15, 2015 at 19:51

1 Answer 1

0

Using sed and writing the output to a new file so it can be checked.

sed 's/c:\\abc\\bcd\\//' csv-file > new-file
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .