Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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 am new to Linux so forgive me if I ask something silly!
I have a problem with file contaning data that should be loaded to Palm device.
This few lines are example of original barcode_temp.txt file unloaded from Linux 6.2 and Informix database.
Just to mention that if I create same file from Windows environment file can easily be loaded into Palm. But we want to automate whole process because it is way easier to use bash script and cron to finish job.
Distribution: At home: Arch, OpenBSD, Solaris. At work: CentOS, Debian, Ubuntu
Posts: 3,625
Rep:
What exactly isn't working? I copied and pasted your text and sed script, and it seems to works fine for me (doing file on the result show it is CRLF delimited). Is it possible you don't have a newline at the end of your last line, so it's just choking on it?
I don't have commas at the end of my dos/win files, I have ^M characters.
Code:
sed -e 's/^M/\^J/g'
Where the ^M is gotten by "C-v C-m" (control+v followed by control+m), and the ^J is gotten by "C-v C-j". ^J represents a linux newline, but it must be escaped with a backslash.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.