Results 1 to 10 of 15
Hi guys... noob here
Can anyone help me with the following:
using the command line i would like to edit a file containing text eg.. 1122334455667788 to 11 22 33 ...
- 08-27-2007 #1Just Joined!
- Join Date
- Aug 2007
- Posts
- 6
help with editing text
Hi guys... noob here

Can anyone help me with the following:
using the command line i would like to edit a file containing text eg.. 1122334455667788 to 11 22 33 44 55 66 77 88, and maybe insert text too.
ive looked at vi, but im confused.
thanks in advance,
blades.
- 08-27-2007 #2forum.guy
- Join Date
- May 2004
- Location
- arch linux
- Posts
- 18,095
Welcome to the forums, blades!

You might take a look at using nano. It's easier to use for most folks that are new to the Linux command line.oz
→ new members/users: read this first | new member faq
→ no private messages requesting computer support - post them on the forums!
→ please use the "report post" button to alert our forum admins to problematic posts rather than responding to them yourself.
- 08-27-2007 #3Just Joined!
- Join Date
- Aug 2007
- Posts
- 6
thanks ozar,
I havent looked at nano.. because its not a command available to me to use.
Im using a 'dreambox' linux satellite receiver.. and the commands installed on it are limited.
attached are the commands i have at my disposal
- 08-27-2007 #4forum.guy
- Join Date
- May 2004
- Location
- arch linux
- Posts
- 18,095
Sorry, but that image is too small to read on this end.
If you want to use vi, just press the letter "i" after you've opened the file and that will put you into insert mode. You can edit your file, then when ready to exit, press ESC to exit insert mode, then :wq (all three characters) to write, quit, and save the file.oz
→ new members/users: read this first | new member faq
→ no private messages requesting computer support - post them on the forums!
→ please use the "report post" button to alert our forum admins to problematic posts rather than responding to them yourself.
- 08-27-2007 #5Just Joined!
- Join Date
- Aug 2007
- Posts
- 2
Hi...
Try this sed command:
sed -i 's/\([0-9]\{2\}\)/&\ /g' file.txt
This will group similar numbers together and separate other groups with a space. So, if your file.txt contains the following text
1122334455667788
After running the above command, it will replace the file contents to
11 22 33 44 55 66 77 88
check it out...
- 08-27-2007 #6forum.guy
- Join Date
- May 2004
- Location
- arch linux
- Posts
- 18,095
blades, is this a homework/classwork question?
oz
→ new members/users: read this first | new member faq
→ no private messages requesting computer support - post them on the forums!
→ please use the "report post" button to alert our forum admins to problematic posts rather than responding to them yourself.
- 08-27-2007 #7Just Joined!
- Join Date
- Aug 2007
- Posts
- 6
- 08-27-2007 #8Just Joined!
- Join Date
- Aug 2007
- Posts
- 6
- 08-27-2007 #9
- 08-27-2007 #10
Well, we need to decide how you want to do this. Are you looking for a text editor, where you go in and manually make changes? Or are you looking for a programmatic solution, where you use some sort of command to do it for you?
If the former, vi is a commandline editor that is available on every UNIX system. It also probably has the steepest learning curve of any program you will ever use in Linux. Try running the 'vimtutor' command from the terminal. If the command exists, this will put you into a tutorial for Vim (the version of vi that is pretty much universal these days). Alternatively, you can try some online tutorial. I found one that may work:
paper
(ignore 1.1)
I don't know of any great vi tutorial (I learned the editor just by messing with it and using vimtutor), but maybe someone else will know.
If you're looking for a programmatic solution, this is where the fun part comes in. It depends a great deal on what the data is, and how it is formatted. If you can explain the problem a bit more, it may be easier to solve.DISTRO=Arch
Registered Linux User #388732


Reply With Quote
