Sponsored Content
Top Forums UNIX for Dummies Questions & Answers How to work with fields of a csv file? Post 302162510 by praveen_b744 on Tuesday 29th of January 2008 06:57:08 AM
Old 01-29-2008
\(^.\)*,\(.*\)/\1"whatever you want to insert here"\2

In this , how did it elects second field?
I came to knw what do '1' and '2' do in this command?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Work CSV file with awk loop

I need to converts a CSV file from Format "A" into Format "B", where the first field is repeated in a loop with a counter. I'am quite sure that this is with AWK possible burt the "Forum Search Function" doesn't work at the moment. Format "A" A1;B1 ;B2 ;B3 A2;C1 ;C2 ;C3 ... (2 Replies)
Discussion started by: frieling
2 Replies

2. Shell Programming and Scripting

How to read and parse the content of csv file containing # as delimeter into fields using Bash?

#!/bin/bash i=0 cat 1.csv | while read fileline do echo "$fileline" IFS="#" flds=( $fileline ) nrofflds=${#flds} echo "noof fields$nrofflds" fld=0 while do echo "noof counter$fld" echo "$nrofflds" #fld1="${flds}" trying to store the content of line to fields but i... (4 Replies)
Discussion started by: barani75
4 Replies

3. Shell Programming and Scripting

How to create a CSV File by reading fields from separate files

SHELL SCRIPT Hi, I have 3 separate files within a folder. Every File contains data in a single column like File1 contains data mayank sushant dheeraj File2 contains DSA_AT MG_AT FLAT_09 File3 contains data 123123 232323 (2 Replies)
Discussion started by: mayanksargoch
2 Replies

4. Shell Programming and Scripting

pulling different fields from a csv file

Hi, I have a requirment where I need to pull different columns from a .csv file. Here is the sample of the csv file. account,item,flag1,flag2,flag3,flag4,flag5,......feed,tran I will be have a config.txt file which will have the following information. item,flag5,flag10,feed,tran... (2 Replies)
Discussion started by: akdevula
2 Replies

5. Shell Programming and Scripting

awk work with time change in csv file

Hi, i have csv input file looks like below 3rd field is date and time field i want to change it with user supplied date and time says year=2011 month=09 day=05 hour=11 count=2 when count is say 10 then first ten records should pick and it should increment the... (2 Replies)
Discussion started by: raghavendra.nsn
2 Replies

6. Shell Programming and Scripting

Comparing two csv file fields using awk script

Hi All, I want to remove the rows from File1.csv by comparing the columns/fields in the File2.csv. I only need the records whose first column is same and the second column is different for the same record in both files.Here is an example on what I need. File1.csv: RAJAK|ACTIVE|1... (2 Replies)
Discussion started by: rajak.net
2 Replies

7. Shell Programming and Scripting

Inserting additional comma delimiters in a csv file, after and before certian fields.

Hello I have a csv file which I need to insert addtional commas into. The csv is of the format field1,field2,field3,field4,...etc...,field13,field14 I need to add extra commas in each record so that the final output looks like ... (1 Reply)
Discussion started by: kamal_p_99
1 Replies

8. Shell Programming and Scripting

Inserting new fields to a csv file

hi I have a csv file with few rows > cat job_stat 1,jobname1,somthing,somthing 2,jobname2,somthing,somthing 3,jobname3,somthing,somthing 4,jobname4,somthing,somthing I want to add few columns after the 2nd column and then append rest of the columns after the 3rd newly added... (3 Replies)
Discussion started by: midhun19
3 Replies

9. Emergency UNIX and Linux Support

How to convert the following characters in some fields in a csv file?

I have a csv file which is produced out of a SED command sed 's/|/","/g; s/^/"/; s/$/"/' A4.txt > A5.csv and I need either an addition to the SED command or a separate command to convert the following characters which occur within the fields in multiple lines 1) "=" to =" and 2)""~ to " (4 Replies)
Discussion started by: etldev
4 Replies

10. UNIX for Beginners Questions & Answers

How to count lines of CSV file where 2 fields match variables?

I'm trying to use awk to count the occurrences of two matching fields of a CSV file. For instance, for data that looks like this... Joe,Blue,Yes,No,High Mike,Blue,Yes,Yes,Low Joe,Red,No,No,Low Joe,Red,Yes,Yes,Low I've been trying to use code like this... countvar=`awk ' $2~/$color/... (4 Replies)
Discussion started by: nmoore2843
4 Replies
passwd(5)							File Formats Manual							 passwd(5)

Name
       passwd - password file

Description
       The file is an ASCII file that contains the following information for each user:

	      Login name
	      Password field
	      User ID
	      Group ID
	      User's real name, office, extension, home phone
	      Initial working directory
	      Program to use as Shell

       Each  line  in the file represents a user entry.  Each field within a user entry is separated from the next by a colon.	Each user entry is
       separated from the next by a new line.  If the password field is null, no password is demanded; if the Shell field is null, then is used.

       This file resides in directory Because the password, if present, is encrypted, the file has general read permission and can  be	used,  for
       example, to map user IDs to names.

       The  ``user's  real name'' can contain an ampersand (&), meaning insert the login name.	This information is set by the command and used by
       the command.

       Appropriate precautions must be taken to lock the file against changes if it is to be edited with a text editor.  The command does the nec-
       essary locking.

       If  the system is running UPGRADE security level and an asterisk appears in the password field, or if the system is running ENHANCED level,
       then the content of the password field is ignored and the password for the account is located in the authentication database. See  and  the
       Security Guide for Administrators for more information.

       The  files  and	if they exist, contain the hashed version of the file.	If present, they are used by the and functions to retrieve entries
       rapidly.  See for more information.

       The database can be distributed in a network by a naming service, such as Yellow Pages or BIND/Hesiod.  See the Guide to the  Yellow  Pages
       Service or the Guide to the BIND/Hesiod Service for setup information.

Restrictions
       The ``name'' can contain only lowercase ASCII characters a to z and the numbers 0 to 9.

Files
See Also
       chfn(1), finger(1), login(1), passwd(1), crypt(3), getpwent(3), auth(5), group(5), adduser(8), mkpasswd(8), vipw(8)
       Guide to the BIND/Hesiod Service
       Guide to the Yellow Pages Service
       Security Guide for Administrators

																	 passwd(5)
All times are GMT -4. The time now is 07:09 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy