Sponsored Content
Top Forums Shell Programming and Scripting Change line into fixed columns Post 302712941 by david-1978 on Wednesday 10th of October 2012 04:56:08 AM
Old 10-10-2012
Hello,

Sorry it is quite difficult to explain.

Right, it is possible to import the fields in excel because is is comma seperated. The problem is that some users have not the same number of columns than others.

Example :

Code:
user1=ou=xxx,ou=yyy,o=zzz
user2=ou=www,ou=xxx,ou=yyy,o=zzz

so in this case if I'll import in excel,

xxx i in the same column than www. That's not what I want. I want to sort it right ajusted.

Code:
user1 "-   blank     " ou=xxx,ou=yyy,o=zzz
user2 ou=www  ou=xxx,ou=yyy,o=zzz

I hope that it is understandable now ;-)

Thanks,
David

Last edited by Scrutinizer; 10-10-2012 at 05:57 AM.. Reason: code tags
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Combining Two fixed width columns to a variable length file

Hi, I have two files. File1: File1 contains two fixed width columns ID of 15 characters length and Name is of 100 characters length. ID Name 1-43<<11 spaces>>Swapna<<94 spaces>> 1-234<<10 spaces>>Mani<<96 spaces>> 1-3456<<9 spaces>>Kapil<<95 spaces>> File2: ... (4 Replies)
Discussion started by: manneni prakash
4 Replies

2. Shell Programming and Scripting

Printing Fixed Width Columns

Hi everyone, I have been working on a pretty laborious shellscript (with bash) the last couple weeks that parses my firewall policies (from a Juniper) for me and creates a nifty little columned output. It does so using awk on a line by line basis to pull out the appropriate pieces of each... (4 Replies)
Discussion started by: cixelsyd
4 Replies

3. Shell Programming and Scripting

Unix sort for fixed length columns and records

I was trying to use the AIX 6.1 sort command to sort fixed-length data records, sorting by specific columns only. It took some time to figure out how to get it to work, so I wanted to share the solution. The sort man page wasn't much help, because it talks about field delimeters (default space... (1 Reply)
Discussion started by: CheeseHead1
1 Replies

4. Shell Programming and Scripting

splitting a huge line of file into multiple lines with fixed number of columns

Hi, I have a huge file with a single line. But I want to break that line into lines of with each line having five columns. My file is like this: code: "hi","there","how","are","you?","It","was","great","working","with","you.","hope","to","work","you." I want it like this: code:... (1 Reply)
Discussion started by: rajsharma
1 Replies

5. UNIX for Dummies Questions & Answers

Filling the empty columns in a fixed column file

Hi, I have a file with fixed number of columns (total 58 columns) delimeted by pipe (|). Due to a bug in the application the export file does not come with fixed number of columns. The missing data columns are being replaced by blank in the output file. In one line I can have 25 columns (33... (1 Reply)
Discussion started by: yale_work
1 Replies

6. Shell Programming and Scripting

awk to print fixed length columns to right side

Hi, I am in a situation to print the message on a column, where the each line starting position should be same. For example code: HOSTNAME1="1.2.3.4.5.6.7" TARGET_DIR="/tmp" echo "HOSTNAME1:" "$HOSTNAME1" | awk -v var="Everyone" '{len=55-length;printf("%s%*s\n",$0,len,var)}' echo... (4 Replies)
Discussion started by: tprabhaker
4 Replies

7. Shell Programming and Scripting

How to parse fixed-width columns which may include empty fields?

I am trying to selectively display several columns from a db2 query, which gives me a fixed-width output (partial output listed here): --------- -------------------------- ------------ ------ 000 0000000000198012 702 29 000 0000000000198013 ... (9 Replies)
Discussion started by: ahsh79
9 Replies

8. Shell Programming and Scripting

Removing duplicates in fixed width file which has multiple key columns

Hi All , I have a requirement where I need to remove duplicates from a fixed width file which has multiple key columns .Also , need to capture the duplicate records into another file . File has 8 columns. Key columns are col1 and col2. Col1 has the length of 8 col 2 has the length of 3. ... (5 Replies)
Discussion started by: saj
5 Replies

9. UNIX for Dummies Questions & Answers

Fixed length file extracting values in columns

How do I extract values in a few columns in a row of a fixed length file? If there are 8 columns and I need to extract values of 2nd,4th and 6 th columns, how do i do that? I used cut command, this I used only for one column. How do I do it more than one column? The below command will give... (1 Reply)
Discussion started by: princetd001
1 Replies

10. Shell Programming and Scripting

Request: How to Parse dynamic SQL query to pad extra columns to match the fixed number of columns

Hello All, I have a requirement in which i will be given a sql query as input in a file with dynamic number of columns. For example some times i will get 5 columns, some times 8 columns etc up to 20 columns. So my requirement is to generate a output query which will have 20 columns all the... (7 Replies)
Discussion started by: vikas_trl
7 Replies
hp-makeuri(1)							   User Manuals 						     hp-makeuri(1)

NAME
hp-makeuri - Device URI Creation Utility DESCRIPTION
Creates device URIs for local and network connected printers for use with CUPS. SYNOPSIS
hp-makeuri [OPTIONS] [SERIAL NO.|USB ID|IP|DEVNODE] SERIAL NO.|USB ID|IP|DEVNODE USB IDs (usb only): "xxx:yyy" where xxx is the USB bus ID and yyy is the USB device ID. The ':' and all leading zeroes must be present. (Use the 'lsusb' command to obtain this information. See Note 1.) IPs (network only): IPv4 address "a.b.c.d" or "hostname" DEVNODE (parallel only): "/dev/parportX", X=0,1,2,... SERIAL NO. (usb and parallel only): "serial no." OPTIONS
To specify the port on a multi-port JetDirect: -p<port> or --port=<port> (Valid values are 1*, 2, and 3. *default) Show the CUPS URI only (quiet mode): -c or --cups Show the SANE URI only (quiet mode): -s or --sane Show the HP Fax URI only (quiet mode): -f or --fax Set the logging level: -l<level> or --logging=<level> <level>: none, info*, error, warn, debug (*default) Run in debug mode: -g (same as option: -ldebug) This help information: -h or --help EXAMPLES
USB: $ hp-makeuri 001:002 Network: $ hp-makeuri 66.35.250.209 Parallel: $ hp-makeuri /dev/parport0 USB or parallel (using serial number): $ hp-makeuri US123456789 NOTES
1. Example using 'lsusb' to obtain USB bus ID and USB device ID (example only, the values you obtain will differ) : $ lsusb Bus 003 Device 011: ID 03f0:c202 Hewlett-Packard $ hp-makeuri 003:011 (Note: You may have to run 'lsusb' from /sbin or another location. Use '$ locate lsusb' to determine this.) SEE ALSO
hp-setup AUTHOR
HPLIP (Hewlett-Packard Linux Imaging and Printing) is an HP developed solution for printing, scanning, and faxing with HP inkjet and laser based printers in Linux. REPORTING BUGS
The HPLIP Launchpad.net site https://launchpad.net/hplip is available to get help, report bugs, make suggestions, discuss the HPLIP project or otherwise contact the HPLIP Team. COPYRIGHT
Copyright (c) 2001-14 Hewlett-Packard Development Company, L.P. This software comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to distribute it under certain conditions. See COPYING file for more details. Linux 5.0 hp-makeuri(1)
All times are GMT -4. The time now is 03:35 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy