Sponsored Content
Top Forums UNIX for Advanced & Expert Users Write to a file in a specified order Post 302461395 by gpsridhar on Monday 11th of October 2010 11:55:14 AM
Old 10-11-2010
I used the command dos2unix while moving the file from my windows to linux server and it worked perfectly Smilie

But i do want to know what exactly does this command do.. because when i transfer my file from windows to my AIX box, my code works fine even without converting.

Is this something specific to LINUX?

---------- Post updated at 09:25 PM ---------- Previous update was at 01:57 PM ----------

I am stuck up with yet another change to this code..

While the following code helps me to cut the columns in the required layout and create a new file, the file generated is comma separated. Is there a way where i can define which delimiter my output file should contain?

Code:
pk1=1,3,2,4
mc1=6,5
pkcols1=`echo $pk1 | sed 's/,/,$/g'`
cols1=`echo $mc1 | sed 's/,/,$/g'`
awk -F, '{print'`echo "$"$pkcols1",$"$cols1`'}' OFS=, file1.txt

I cannot use a sed and replace the comma with the delimiter i need, because my input file might contain comma in the data. SmilieSmilie

Last edited by Scott; 10-11-2010 at 02:30 PM.. Reason: Code tags, please...
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

creating a file in reverse order of another file

Hi, I have a requirement where i need to write a script to create the new file from the given input file with the data in reverse order (bottom to top) Sample data: Input File-------------- Java VB Oracle Teradata Informatica Output file:----------------- Informatica Teradata Oracle... (3 Replies)
Discussion started by: srilaxmi
3 Replies

2. Shell Programming and Scripting

Reversing file order using SED

Im trying to develop a shell script that will change the content order of the file. For example I have a file that says a b c d I want to change this to be d c b a Im trying to use sed to this by reading the file and then inserting each line at the top #!/usr/bin/ksh ... (3 Replies)
Discussion started by: MBGPS
3 Replies

3. Shell Programming and Scripting

sed or awk to order a file

Hi - I have a file with lots of lines in that I need to order based on the number of commas! e.g the file looks something like :- cn=john,cn=users,cn=uk,dc=dot,dc=com cn=john,cn=users,dc=com cn=users,cn=groups,dc=com cn=john,cn=admins,cn=users,cn=uk,dc=dot,dc=com... (4 Replies)
Discussion started by: sniper57
4 Replies

4. Shell Programming and Scripting

Order file by lines

My script(3 arguments $1 = folder,$2 extension,$3 string) should do the following things: -Enter in the folder of $1(if exists). -Put ls *.$2 > temp.txt ( I use a temp file to store the result of ls command and if $2 = txt in this file I'll have all the .txt files of the folder) -Now I want to... (2 Replies)
Discussion started by: Max89
2 Replies

5. IP Networking

read/write,write/write lock with smbclient fails

Hi, We have smb client running on two of the linux boxes and smb server on another linux system. During a backup operation which uses smb, read of a file was allowed while write to the same file was going on.Also simultaneous writes to the same file were allowed.Following are the settings in the... (1 Reply)
Discussion started by: swatidas11
1 Replies

6. Solaris

Specifying file system mount order

Does anyone know if it's possible to specify the mount order of local and remote file systems? I'd like to mount a local ZFS file system on top of an NFS mount automatically and have that repeated on every reboot. I've checked man pages and Google, but can't find anything that addresses,... (6 Replies)
Discussion started by: Monty51
6 Replies

7. Shell Programming and Scripting

File listing in Ascending order

I have a multiple file with the following name like. file_0.csv file_1.csv file_2.csv file_3.csv file_4.csv file_5.csv file_6.csv file_7.csv file_7.csv file_8.csv file_9.csv file_10.csv file_11.csv file_12.csv file_13.csv file_14.csv (2 Replies)
Discussion started by: rakesh_arxmind
2 Replies

8. Shell Programming and Scripting

Read input files and merge them in given order and write them to input one param or one file

Dear Friends, I am looking for a shell script to merge input files into one file .. here is my idea: 1st paramter would be outfile file (all input files content) read all input files and merge them to input param 1 ex: if I pass 6 file names to the script then 1st file name as output file... (4 Replies)
Discussion started by: hyd1234
4 Replies

9. Shell Programming and Scripting

Order of data in Spool File

Hello, I have a shell script through which I am executing .sql file and spooling the result of Query from .sql . I want to spool the result in ascending order. Is there any parameter to be set to print result in ascending or descending order. Thanks in advance. (4 Replies)
Discussion started by: Aparna.N
4 Replies

10. Shell Programming and Scripting

File globbing order

Hi , I'm facing a different behaviour with one of my shell script for last few days. It was working good before that. here is my code for the script FileRemove.sh #get the file name# file1=$1 file2=$2 rm $file1 # delete the old file mv $file2 <target path> #move the new file to the target... (5 Replies)
Discussion started by: poova
5 Replies
asadmin-update-connector-security-map(1AS)			   User Commands			asadmin-update-connector-security-map(1AS)

NAME
asadmin-update-connector-security-map, update-connector-security-map - updates the security map for the named connector connection pool SYNOPSIS
update-connector-security-map --user admin_user [--password admin_password][--host localhost] [--port 4848][--secure|-s] [--passwordfile filename] [--terse=false] [--echo=false] [--interactive=true] --poolname connector_connection_pool_name [--addprincipals principal-name[, principal-name]*]| [--addusergroups user-group[, user-group]*] [--removeprincipals principal-name[, principal-name]* ] [--removeusergroups user-group[, user-group]*] [--mappedusername user_name] [[--mappedpassword password]] mapname Modifies a security map for the named connector connection pool. You must have first created a connector connection pool using the create- connector-connection-pool command. This command is supported in remote mode only. OPTIONS
--user authorized domain application server administrative username. --password password to administer the domain application server. --host machine name where the domain application server is running. --port port number of the domain application server listening for administration requests. --secure if true, uses SSL/TLS to communicate with the domain application server. --passwordfile file containing the domain application server password. --terse indicates that any output data must be very concise, typically avoiding human-friendly sentences and favoring well- formatted data for consumption by a script. Default is false. --echo setting to true will echo the command line statement on the standard output. Default is false. --interactive if set to true (default), only the required password options are prompted. --poolname connector connection pool name for which the security map that is to be updated or created belongs to. --addprincipals a comma separated list of backend EIS principals to be added. --addusergroups a comma separated list of the enterprise information system usergroups to be added. --removeprincipals a comma separated list of the enterprise information system principals to be removed. --removeusergroups a comma separated list of the enterprise information system usergroups to be removed. --mappedusername the enterprise information system username. --mappedpassword the enterprise information system password. OPERANDS
mapname name of the security map to be updated. Example 1: Using update-connector-security-map It is assumed that the connector pool has already been created using the create-connector-pool command. asadmin> update-connector-security-map --user admin --password adminadmin --poolname connector-pool1 --addprincipals principal1, principal2, --addusergroups usergroup1, usergroup2 --removeprincipals principal3, principal4 --removeusergroups usergroup3, usergroup4 securityMap1 Command update-connector-security-map executed successfully EXIT STATUS
0 command executed successfully 1 error in executing the command asadmin-create-connector-security-map(1AS), asadmin-delete-connector-security-map(1), asadmin-list-connector-security-maps(1AS) J2EE 1.4 SDK March 2004 asadmin-update-connector-security-map(1AS)
All times are GMT -4. The time now is 05:50 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy