Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Need help on an old post - How to convert a comma delimited string to records or lines of text? Post 303028784 by newbie_01 on Tuesday 15th of January 2019 03:59:20 AM
Old 01-15-2019
Need help on an old post - How to convert a comma delimited string to records or lines of text?

Hi,

Apologies in advance to the moderator if I am posting this the wrong way.

I've searched and found the solution to an old post but as it is a very old post, I don't see an option to update it with additional question.

The question I have is in relation to the following post:

How to convert a comma delimited string to records or lines of text?

I just want to know if there is a way to number the output. At the moment, I am piping the output to nl to generate a numbered list. I just want to know how I can change the following so it can be a numbered output without using nl.

Not sure if I should PM RudiC or RavinderSingh13, sorry.

Code:
tr ',' '\n' < file3
user1
user2
user3
user4

awk -F"," '{for(i=1;i<=NF;i++){print $i}}' Input_file
OR
awk '{gsub(/\,/,"\n",$0);print $0}' Input_file


Last edited by rbatte1; 01-15-2019 at 07:29 AM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to convert this file into comma delimited format

Hi experts, I need urget help! I have the a text file with this format: Types of fruits Name of fruits 1,1 Farm_no,1 apple,1 pineapple,1 grapes,1 orange,1 banana,1 2,2--->this is the record seperator Farm_no,2 apple,1 pineapple,1 grapes,3 orange,2 banana,1 3,3--->this is the... (1 Reply)
Discussion started by: natalie23
1 Replies

2. UNIX for Advanced & Expert Users

Urgent! need help! how to convert this file into comma delimited format

Hi experts, I need urget help! I have the a text file with this format: Types of fruits Name of fruits 1,1 Farm_no,1 apple,1 pineapple,1 grapes,1 orange,1 banana,1 2,2--->this is the record seperator Farm_no,2 apple,1 pineapple,1 grapes,3 orange,2 banana,1 3,3--->this is the... (2 Replies)
Discussion started by: natalie23
2 Replies

3. Shell Programming and Scripting

how to Insert values in multiple lines(records) within a pipe delimited text file in specific cols

this is Korn shell unix. The scenario is I have a pipe delimited text file which needs to be customized. say for example,I have a pipe delimited text file with 15 columns(| delimited) and 200 rows. currently the 11th and 12th column has null values for all the records(there are other null columns... (4 Replies)
Discussion started by: vasan2815
4 Replies

4. Shell Programming and Scripting

Print records which do not have expected number of fields in a comma delimited file

Hi, I have a comma (,) delimited file, in which few fields are enclosed with in double quotes " ". I have to print the records in the file which donot have expected number of field with the line number. File1 ==== name,desgnation,doj,project #header#... (7 Replies)
Discussion started by: machomaddy
7 Replies

5. Shell Programming and Scripting

how to convert comma delimited file to tab separator

Hi all, How can i convert comma delimited .csv file to tab separate using sed command or script. Thanks, Krupa (4 Replies)
Discussion started by: krupasindhu18
4 Replies

6. Shell Programming and Scripting

Need a script to convert comma delimited files to semi colon delimited

Hi All, I need a unix script to convert .csv files to .skv files (changing a comma delimited file to a semi colon delimited file). I am a unix newbie and so don't know where to start. The script will be scheduled using cron and needs to convert each .csv file in a particular folder to a .skv... (4 Replies)
Discussion started by: CarpKing
4 Replies

7. UNIX for Dummies Questions & Answers

How to change a line of text to a comma delimited string?

Hi, Is there a one-liner that I can use to change a line of text into a comma delimited string? For example, convert user1 user2 user3 user4to user1,user2,user3,user4Currently using while read x, although got the extra comma at the end that I have to remove manually. Please... (5 Replies)
Discussion started by: newbie_01
5 Replies

8. UNIX for Dummies Questions & Answers

How to convert a comma delimited string to records or lines of text?

Hi, I am not sure if I've posted this question before. Anyway, I previously asked about converting lines of text into a comma delimited string. Now I am needing to do the other way around ... :( :o Can anyone advise how is this possible? Example as below: Converting records/lines to... (2 Replies)
Discussion started by: newbie_01
2 Replies

9. Shell Programming and Scripting

Help/Advise please for converting space delimited string variable to comma delimited with quote

Hi, I am wanting to create a script that will construct a SQL statement based on a a space delimited string that it read from a config file. Example of the SQL will be For example, it will read a string like "AAA BBB CCC" and assign to a variable named IN_STRING. I then concatenate... (2 Replies)
Discussion started by: newbie_01
2 Replies

10. Shell Programming and Scripting

Linux convert Comma delimited file to pipe

I have file in linux with comma delimited and string fields in double quotations ", I need to convert them to pipe delimiter please share your inputs. Example: Input: "2017-09-30","ACBD,TVF","01234",NULL,18,NULL,"686091802","BANK OF ABCD, LIMITED, THE",790456 Output: ... (4 Replies)
Discussion started by: shieksir
4 Replies
POST-REVIEW(1)							   User Commands						    POST-REVIEW(1)

NAME
post-review - post/update reviews to Review Board SYNOPSIS
post-review [-pond] [-r review_id] [changenum] OPTIONS
Review Request Options -p, --publish publish the review request immediately after submitting -r ID, --review-request-id=ID existing review request ID to update --revision-range=REVISION_RANGE generate the diff for review based on given revision range Server Options --server=SERVER specify a different Review Board server to use --submit-as=USERNAME user name to be recorded as the author of the review request, instead of the logged in user --username=USERNAME user name to be supplied to the reviewboard server --password=PASSWORD password to be supplied to the reviewboard server Basic Options --version show program's version number and exit -h, --help show this help message and exit -o, --open open a web browser to the review request page -n, --output-diff outputs a diff to the console and exits. Does not post Field Defaults Options --target-groups=TARGET_GROUPS names of the groups who will perform the review --target-people=TARGET_PEOPLE names of the people who will perform the review --summary=SUMMARY summary of the review --description=DESCRIPTION description of the review --description-file=DESCRIPTION_FILE text file containing a description of the review --testing-done=TESTING_DONE details of testing done --testing-done-file=TESTING_FILE text file containing details of testing done --branch=BRANCH affected branch --bugs-closed=BUGS_CLOSED list of bugs closed --change-only updates info from changelist, but does not upload a new diff (only available if your repository supports changesets) --tracking-branch=TRACKING Tracking branch from which your branch is derived (git only, defaults to origin/master) --p4-client=P4_CLIENT the Perforce client name that the review is in --p4-port=P4_PORT the Perforce servers IP address that the review is on -d, --debug display debug output --diff-filename=DIFF_FILENAME upload an existing diff file, instead of generating a new diff Git Options --guess-summary guess summary from the latest commit (git/hgsubversion only) --guess-description guess description based on commits on this branch (git/hgsubversion only) Git and Mercurial Options --parent=PARENT_BRANCH the parent branch this diff should be against (only available if your repository supports parent diffs) Subversion Options --repository-url=REPOSITORY_URL the url for a repository for creating a diff outside of a working copy (currently only supported by Subver- sion). Requires either --revision-rangeor --diff-filename options Perforce Options --diff-only uploads a new diff, but does not update info from changelist ClearCase Options --label=LABEL Specifies the label used for ClearCase. DESCRIPTION
post-review is intended to post a review from a local repository to the Review Board server, or update such an existing review. It works differently with different version-control systems. For CVS and Subversion, the review to post is the uncommited change in a working copy. With distributed VC systems (currently Git and Mercurial are supported), the review is a topic branch. Posting it is, technically, pushing it to the repository at the Review Board server. PerForce and ClearCase also seem to be supported but the author of this page fails to understand the details. Refer to undocumented(7) for more information on using them with this program. [A more detaild description can help] CONFIGURATION
post-review needs to be told of the address of the server to post to. This can come from several possible places: GIT property reviewboard.url For example, the following command will set a repository-specific property: git config --add reviewboard.url http://reviewboard.example.com Refer to git-config(1) for the full details. Subversion Property reviewboard:url The subversion property reviewboard:url may be set on the top-level directory. svn propset reviewboard:url http://reviewboard.example.com . Perforce Counters Rumour has it they exist and can even help in the configuration here. .reviewboardrc $HOME/.reviewboardrc The file .reviewboardrc can exist in either the top-level directory of the project or under the user's top-level directory. This file uses python syntax for assignments. It has two optionalmethods of defining the repository URL: REVIEWBOARD_URL A simple variable pointing to the server: REVIEWBOARD_URL = "http://reviewboard.example.com" TREES A directionary of subversion repositories to REVIEWBOARD_URL-s: TREES = { 'http://svn.example.com': { 'REVIEWBOARD_URL': 'http://rb.example.com', }, 'username@cvs.example.com:/cvsroot/cvs': { 'REVIEWBOARD_URL': 'http://rb.example.com', }, } EXAMPLES
post a new review from a working subversion copy: post-review This generates a new draft review. Refer to the "Field Defaults" options above to set non-empty values to some fields in the review. Alter- natively set them later through the web interface. Update that review, assuming its review number is 17: post-review -r 17 To post a review from a your GIT feature branch: git checkout -b new-feature main-branch emacs -f butterfly '.......' # or ed git commit post-review [That said, I can't really follow the documentation as to how post-review works on git/hg: how does it post the last diff only?] This does not create a new diff. Rather, it updates the existing one. In the following two examples, the review was not published. AUTHOR
post-review was written by Christian Hammond and David Trowbridge. This man page was written by Tzafrir Cohen <tzafrir.cohen@xorcom.com>. SEE ALSO
On-Line Documentation <http://www.reviewboard.org/docs/manual/dev/users/tools/post-review/> post-review 0.8 March 2010 POST-REVIEW(1)
All times are GMT -4. The time now is 09:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy