LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-30-2005, 06:20 PM   #16
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928

Something like
Code:
sed 's/\(........\)\(......\)\(......\)\(......\)\(......\)\(......\)\(......\)/\1\n\2\n\3\n\4\n\5\n\6\n\7\n\n/' filename
?
Personally I find it ugly ;}




Cheers,
Tink

Last edited by Tinkster; 11-30-2005 at 06:21 PM.
 
Old 12-01-2005, 01:24 AM   #17
evoGage
LQ Newbie
 
Registered: Nov 2005
Posts: 15

Original Poster
Rep: Reputation: 0
Thank you very much. Might be ugly but I should start off with the basics.
 
Old 12-01-2005, 11:31 AM   #18
evoGage
LQ Newbie
 
Registered: Nov 2005
Posts: 15

Original Poster
Rep: Reputation: 0
Now I'm really getting into this, is there a way to put an extra character next to the ones that exsists and make a space?

For example

from this:

96000123
01FXTF
02FTXT
03FFTF
04TFXX
05TXFF
06TTTT

to:

96000123
01 FF XF TT FF
02 FF TT XF TT
03 FF FT TT FF
04 TF FT XT XT
05 TF XF FT FF
06 TT TF TF TF
 
Old 12-01-2005, 11:37 AM   #19
Yogiz
LQ Newbie
 
Registered: Dec 2005
Posts: 13

Rep: Reputation: 0
If you don't do the assignment by tomorrow would that mean you will fail the unit?

Nice
 
Old 12-01-2005, 11:41 AM   #20
evoGage
LQ Newbie
 
Registered: Nov 2005
Posts: 15

Original Poster
Rep: Reputation: 0
lol I know people will say that. It may look fishy but I'm doing this for myself as this will be the only way I get help from people on here. I'm 16 yr old so kinda too young for uni.
 
Old 12-01-2005, 11:44 AM   #21
Yogiz
LQ Newbie
 
Registered: Dec 2005
Posts: 13

Rep: Reputation: 0
How can you be 16 years old and doing what Im doing this is clearly plagiarism. Why wont you post the whole assignment on to here instead of doing it in bits and waiting for the answers. Lol

Read the notes and you might learn something..

Last edited by Yogiz; 12-01-2005 at 11:46 AM.
 
Old 12-01-2005, 11:46 AM   #22
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Quote:
Originally posted by evoGage
Now I'm really getting into this, is there a way to put an extra character next to the ones that exsists and make a space?

For example

from this:

96000123
01FXTF
02FTXT
03FFTF
04TFXX
05TXFF
06TTTT

to:

96000123
01 FF XF TT FF
02 FF TT XF TT
03 FF FT TT FF
04 TF FT XT XT
05 TF XF FT FF
06 TT TF TF TF
Sure ... take my statement, and introduce a couple more braces...
Oh, wait. No, you'd be getting more than 10 replacement strings.
Go with the awk solution ;)


Cheers,
Tink
 
Old 12-01-2005, 11:46 AM   #23
evoGage
LQ Newbie
 
Registered: Nov 2005
Posts: 15

Original Poster
Rep: Reputation: 0
No offence but just because I have an intrest in unix programming, does it automatically make me a student who is studying unix?
 
Old 12-01-2005, 11:55 AM   #24
Yogiz
LQ Newbie
 
Registered: Dec 2005
Posts: 13

Rep: Reputation: 0
Well mate I got assignment to do. Looks exatly the same what you doing here. Well is ur business. Just a bit sad..
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
C++ text file line by line/each line to string/array Dimitris Programming 15 03-11-2008 08:22 AM
Line Splitting evoGage Solaris / OpenSolaris 1 11-30-2005 03:34 AM
splitting strings marri Programming 5 04-08-2005 05:33 PM
linux scripting help needed read from file line by line exc commands each line read atokad Programming 4 12-26-2003 10:24 PM
Splitting my 6o Madmanator Linux - Newbie 1 01-03-2002 11:21 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration