This "monica.txt" file isn't text, it's RTF! Hoping you knew that, but maybe you didn't. Substitution's still possible of course.
Boy, it's sure obnoxious having to work with BSD sed after having used GNU sed... Things any rational person would guess were basic, basic, basic features, like \n, don't work.
I did eventually manage to get it to do this:
Yes, that is a literal newline inside the expression. You have to put a \ before the enter key to "escape" it or BSD sed will whine about it. It may be possible to substitute it in by putting the expression in double quotes, and using $'\n', but this may be more trouble than it's worth and involve outrageous numbers of backslashes.
By the way, 'cat file | program' is a useless use of cat. You can do it faster and just as simply with
or, if you prefer the file being in front, that works too:
Please attach files in a flat format. Anyway, assuming the first instance of ";;;;" is on the first line:
Use nawk or /usr/xpg4/bin/awk on Solaris.
I hate to be a pain, but I'm still getting the return "awk: illegal statement at source line 3
context is
{print > "comment" >>> c <<< ".txt"}" when I run this code. Does anyone know how what is wrong with the third line?
---------- Post updated at 01:25 AM ---------- Previous update was at 01:22 AM ----------
Quote:
Originally Posted by Corona688
This "monica.txt" file isn't text, it's RTF! Hoping you knew that, but maybe you didn't. Substitution's still possible of course.
Boy, it's sure obnoxious having to work with BSD sed after having used GNU sed... Things any rational person would guess were basic, basic, basic features, like \n, don't work.
I did eventually manage to get it to do this:
Yes, that is a literal newline inside the expression. You have to put a \ before the enter key to "escape" it or BSD sed will whine about it. It may be possible to substitute it in by putting the expression in double quotes, and using $'\n', but this may be more trouble than it's worth and involve outrageous numbers of backslashes.
]
Excuse my ignorance, but what do you mean by "newline inside the expression"? What would the full complete code be, exactly?
Excuse my ignorance, but what do you mean by "newline inside the expression"?
Exactly what I said, no more, no less. The newline isn't represented by \n or anything. There's a real, actual newline inside the string. Note how one string crosses two lines:
Basically, I want it to take the file monica.txt and put every instance of ;;; on a new line and put it in fixed.txt, then split fixed.txt at every instance of ;;; and put it in new files called comment0001.txt, comment0002.txt,... comment2500.txt.
hi guys.
I have an Kaon router wich runs "Linux version 3.10.24-svn1480 (jskim@jake-205) (gcc version 4.4.7 (Realtek MSDK-4.4.7 Build 1459".
The problem I have it is that its firmware is in early stages and has alot of things messed up.
Wake on lan doesn't work without arp binding and that can... (23 Replies)
guys im new here and i need help with some linux commands.
filea has keyword on each line
identity
aaa
bbb
ccc
i have following commands.
egrep 'www.identity' ~/home/m3 >~/home/lopo2
wc -l file ~/home/lopo2
say lopo2 has 44 lines
then output saved is
identity 44 (1 Reply)
Hi Friends
I am trying to install linux (32 bit) on windows.
so i used Oracle virtual box and Vmware player in windows and installed them.
but there is no category to select Linux version 7.
how to install it pls help here. (7 Replies)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
2. Shell Bash Script
3.
!/bin/bash
if
echo no directory
then
mkdir -p /home/AC_Drywall
elif ; then
echo "$dir already exist"
fi (4 Replies)
HI,
My requirement as below
Log with Error
Code:
Starting FeedRunner for feed: 200 Product example Items
Error FeedRunner for feed: 200 Product example Items
Stopping FeedRunner for feed : 200 Product example Items Feed time taken 231743
Log without Error
Code:
... (0 Replies)
Hi guys , I m new to linux and would like to buy some quality video tutorials .
Request you to guide me any good source for programming(C,Java,VB) or linux tutorials.
Tutorials should be known and good like lynda.com (5 Replies)
Good evening everyone! :)
I'm doing a small client / server application for sharing files in C, and I am trying to implement the following:
The client of my application sends to the address 255.255.255.255 a message requesting a particular file.In the network there is only one server,... (1 Reply)
:confused:
hi guys i'm helping out as a lab assistant and have been told to use a linux shell script to gather assignments from the students in the class I'm helping out in. They've been told to have their assignment in a certain folder in their accounts and I'm to gather them, only problem is I... (0 Replies)