Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This 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!


  Search this Thread
Old 06-11-2015, 12:46 PM   #1
LQ Newbie
Registered: Dec 2011
Posts: 1

Rep: Reputation: Disabled
Need to manipulate data...

can someone help me with this....

Input data

name abc
subject 111
name abd
subject 112
name abe
subject 113
subject 114
name abf
name abg
subject 115

Required Output

abc 111
abd 112
abe 113 114
abg 115

thanks in advance..
Old 06-11-2015, 01:45 PM   #2
Registered: Mar 2011
Location: Sutton, MA. USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu
Posts: 5,969
Blog Entries: 12

Rep: Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038
You've asked your question very poorly. I'm half thinking "Welcome to LQ" because it's your first post, however it also shows you registered in 2011. So you may have registered and never looked at any threads, or maybe you've just looked at threads over the years when needed and never needed to ask a question. Either case, in these forums, the responders are not paid, they're being collaborative to help others, but also the main idea is to help others to learn how to do these things on their own so that they can move further.

Therefore a program or script is the most typical solution. To that people will want to know what, if anything you have tried, and like to see you post that within [code][/code] tags, or at least indicate whether or not you have even started coding anything and that this would be where you need help, such as starting. So please do this.

Another thing to consider is the definition of the problem. You have example input/output, which seems pretty good; however you need to consider whether or not there can be varied interpretations of the output or even variations on the input which can't be shown in the illustrations.

For instance, "abf" does not show in the output, but one possible interpretation is that "abf" shows in the output by itself with no subjects. This interpretation shows that "abf" exists, but that the name has no subjects. As the problem/solution is shown, "abf" will not presently show up as being present, which may be your intent, but just opening this line of thinking.

Also "abe" is an example of a name with two subjects. This is fine and illustrates this possibility. But what would be the limits on that? In other words, can a name have 500 subjects? 10 subjects? How many maximum?

Next would be any possible variations for the names and subject numbers. Can subject numbers be 1, 2, 3, 4, 5, 6, or more digits? Or do they always have to be 3 digits?

Your example shows entirely unique subjects per name. Can different names use the same subject number?

And what about a repeated name?

If this is a school assignment, that's all fine, but understand that you need to state this and also put in your own effort to try and solve it and people will be responsive with suggestions to improve or get you past a stuck point. Right now, all you've done is ask for a solution.
Old 06-12-2015, 05:52 AM   #3
LQ Guru
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,564

Rep: Reputation: 2901Reputation: 2901Reputation: 2901Reputation: 2901Reputation: 2901Reputation: 2901Reputation: 2901Reputation: 2901Reputation: 2901Reputation: 2901Reputation: 2901


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
LXer: Manipulate smartphone GPS data with QGIS LXer Syndicated Linux News 0 10-22-2012 10:11 PM
Manipulate data arn2025 Linux - Newbie 13 08-30-2012 11:05 AM
awk: how to read dan manipulate data in multi files from a file mauludi Linux - Newbie 4 05-27-2011 02:52 AM
want to open & manipulate column data from excel file. rinu budhbhatti Member Intro 1 02-01-2011 09:50 AM
manipulate dcop data for File commandS? carl0ski Programming 2 07-02-2005 09:46 PM > Forums > Linux Forums > Linux - Newbie

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

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