Sponsored Content
Full Discussion: Reformat Data (Perl)
Top Forums Shell Programming and Scripting Reformat Data (Perl) Post 302305246 by flood on Wednesday 8th of April 2009 10:31:18 AM
Old 04-08-2009
Reformat Data (Perl)

I am new to Perl. I need to reformat a data file as the last part of a script I am working on. I am stuck on this.

Here is the current format:

CUSTOMER Filename 09/04/07-08:49
CUSTOMER Filename 09/04/07-08:52
CUSTOMER Filename 09/04/07-08:52
CUSTOMER2 Filename 09/04/07-08:49
CUSTOMER2 Filename 09/04/07-08:52
CUSTOMER2 Filename 09/04/07-08:52

I need it to look like this:

CUSTOMER
Filename 09/04/07-08:49
Filename 09/04/07-08:52
Filename 09/04/07-08:52

CUSTOMER2
Filename 09/04/07-08:49
Filename 09/04/07-08:52
Filename 09/04/07-08:52

Any ideas? I've thought about looping thru the list and storing each list item as a variable and then printing the variables, but I haven't worked out how exactly to do it.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

help reformat data with awk

I am trying to write an awk program to reformat a data table and convert the date to julian time. I have all the individual steps working, but I am having some issues joing them into one program. Can anyone help me out? Here is my code so far: # This is an awk program to convert the dates from... (4 Replies)
Discussion started by: climbak
4 Replies

2. Shell Programming and Scripting

reformat data with a shell script

Can anyone help me with a shell script that can do the following: I have a data in fasta format (first line is the header, followed by a sequence of characters). >ALLLY GGCCCCTCGAGCCTCGAACCGGAACCTCCAAATCCGAGACGCTCTGCTTATGAGGACCTC GAAATATGCCGGCCAGTGAAAAAATCTTGTGGCTTTGAGGGCTTTTGGTTGGCCAGGGGC... (5 Replies)
Discussion started by: manishabh
5 Replies

3. Shell Programming and Scripting

Reformat the data of a file.

I have a file which have data like A.txt a 1Jan I am in a1. 1Jan I was born. 2Jan I am here. 3Jan I am in a3. b 1Jan I am in b1. c 2Jan I am in c2. d 2Jan I am in d2. 5jan I am in d5. date in the file might be vary evertime. (9 Replies)
Discussion started by: samkhu
9 Replies

4. Shell Programming and Scripting

Split, Search and Reformat by Data Group

Hi, I am writing just to share my appreciation for help I have received from this site in the past. In a previous post Split File by Data Group I received a lot of help with a troublesome awk script to reformat some complicated data blocks. What I learned really came in hand recently when I... (1 Reply)
Discussion started by: mkastin
1 Replies

5. Shell Programming and Scripting

Help with reformat data content

input file: hsa-miR-4726-5p Score hsa-miR-483-5p Score hsa-miR-125b-2* Score hsa-miR-4492 hsa-miR-4508 hsa-miR-4486 Score Desired output file: hsa-miR-4726-5p Score hsa-miR-483-5p Score hsa-miR-125b-2* Score hsa-miR-4492 hsa-miR-4508 hsa-miR-4486 Score ... (6 Replies)
Discussion started by: perl_beginner
6 Replies

6. Shell Programming and Scripting

Help with reformat input data

Input file: 58227131 50087390 57339526 40578034 65348841 55614853 64363217 44178559 Desired output file: 58227131 50087390 57339526 40578034 65348841 55614853 64363217 44178559 Command that I try: (4 Replies)
Discussion started by: perl_beginner
4 Replies

7. Shell Programming and Scripting

Reformat MLS Data - Use AWK?

I am helping my wife set up a real estate site and I am starting to integrate MLS listings. We are using a HostGator level 5 VPS running CentOS and have full root and SSH access to the VPS. Thus far I have automated the daily FTP download of listings from our MLS server using a little sh script.... (4 Replies)
Discussion started by: Chicago_Realtor
4 Replies

8. Shell Programming and Scripting

Data reformat and rearrangement problem asking

Input file: dependent general_process dependent general_process regulation general_process - - template component food component binding data_rearrangement binding data_rearrangement specific_activity data_rearrangement - ... (7 Replies)
Discussion started by: cpp_beginner
7 Replies

9. Shell Programming and Scripting

Help with reformat data structure

Input file: bv|111259484|pir||T49736_real_data bv|159484|pir||T9736_data_figure bv|113584|prf|T4736|truth bv|113584|pir||T4736_truth Desired output: bv|111259484|pir|T49736|real_data bv|159484|pir|T9736|data_figure bv|113584|prf|T4736|truth bv|113584|pir|T4736|truth Once the... (8 Replies)
Discussion started by: perl_beginner
8 Replies

10. Shell Programming and Scripting

Help with reformat data set

Input file 4CL1 O24145 CoA1 4CL1 P31684 CoA1 4CL1 Q54P77 CoA_1 73 O36421 Unknown 4CL3 Q9S777 coumarate 4CL3 Q54P79 coumarate 4CL3 QP7932 coumarate Desired output result 4CL1 O24145#P31684 CoA1 4CL1 Q54P77 CoA_1 73 O36421 Unknown 4CL3 Q9S777#Q54P79#QP7932 coumarate I... (5 Replies)
Discussion started by: perl_beginner
5 Replies
shishi_init_with_paths(3)					      shishi						 shishi_init_with_paths(3)

NAME
shishi_init_with_paths - API function SYNOPSIS
#include <shishi.h> int shishi_init_with_paths(Shishi ** handle, const char * tktsfile, const char * systemcfgfile, const char * usercfgfile); ARGUMENTS
Shishi ** handle pointer to handle to be created. const char * tktsfile Filename of ticket file, or NULL. const char * systemcfgfile Filename of system configuration, or NULL. const char * usercfgfile Filename of user configuration, or NULL. DESCRIPTION
Create a Shishi library handle, using shishi(), and read the system configuration file, user configuration file, and user tickets from the specified locations. If any of usercfgfile or systemcfgfile is NULL, the file is read from its default location, which for the system con- figuration file is decided at compile time, and is $sysconfdir/shishi.conf, and for the user configuration file is $HOME/.shishi/config. If the ticket file is NULL, a ticket file is not read at all. The handle is allocated regardless of return values, except for SHISHI_HANDLE_ERROR which indicates a problem allocating the handle. (The other error conditions comes from reading the files.) RETURN VALUE
Returns SHISHI_OK iff successful. REPORTING BUGS
Report bugs to <bug-shishi@gnu.org>. COPYRIGHT
Copyright (C) 2002-2010 Simon Josefsson. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. SEE ALSO
The full documentation for shishi is maintained as a Texinfo manual. If the info and shishi programs are properly installed at your site, the command info shishi should give you access to the complete manual. shishi 1.0.1 shishi_init_with_paths(3)
All times are GMT -4. The time now is 11:59 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy