ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
i would like help editing variable length .csv files. since i want to save over the original file, i dont think sed-awk will work for me. i have a c program that will read a single column file, edit it, and write to another file but i have no idea how to edit it in 'real-time'. the column i want to change will always be in 4th column.
the basic idea (if you want your code to be portable) is
1) slurp the file (= read into memory)
2) edit in-memory
3) save to disk
I think it's possible to tell the kernel to tell the filesystem to modify in-place, but depending on the fs, it might or might not like changing the size. I wouldn't have a whelk's idea in a supernova as to how, though.
Originally posted by schneidz i would like help editing variable length .csv files. since i want to save over the original file, i dont think sed-awk will work for me. i have a c program that will read a single column file, edit it, and write to another file but i have no idea how to edit it in 'real-time'. the column i want to change will always be in 4th column.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.