hi, i need to insert a character in a certain text file. i cannot change the original files so i have to work with that, luckily the files are written in a way that at the end of every second line a semicolon ; has to be inserted. How can i do this? thanks in advance

Recommended Answers

All 3 Replies

hi, i need to insert a character in a certain text file. i cannot change the original files so i have to work with that, luckily the files are written in a way that at the end of every second line a semicolon ; has to be inserted. How can i do this? thanks in advance

you should give an example or a sample of the contents of the original file and your expected output.

you should give an example or a sample of the contents of the original file and your expected output.

Thanks but i found out already

sed 'n;s/$/;/' filename > newfilename
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.