Sponsored Content
Full Discussion: insert delimiter
Top Forums Shell Programming and Scripting insert delimiter Post 302533838 by yazu on Friday 24th of June 2011 09:46:39 PM
Old 06-24-2011
Code:
echo 20110624000744000693000704000764 |  
perl -lne '
($pref, $suf) = /(.{8})(.*)/;
$suf =~ s/.{6}(?=.)/$&./g;
print "$pref.$suf"'
20110624.000744.000693.000704.000764

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Insert text between delimiter

Can someone help me on this? I'm creating an Insert stmt script but Oracle does not accept blanks values. How can I insert the word null between two commas? I'm guessing awk or sed. Is there a good post or site with easy to understand info on awk and sed? I'm really new to unix scripts :D ... (5 Replies)
Discussion started by: ystee
5 Replies

2. Shell Programming and Scripting

Substring based on delimiter, finding last delimiter

Hi, I have a string like ABC.123.XYZ-A1-B2-P1-C4. I want to delimit the string based on "-" and then get result as only two strings. One with string till last hyphen and other with value after last hyphen... For this case, it would be something like first string as "ABC.123.XYZ-A1-B2-P1" and... (6 Replies)
Discussion started by: gupt_ash
6 Replies

3. UNIX for Advanced & Expert Users

Insert Delimiter at fixed locations in a flat file

Hi Can somebody help me with solution for this PLEASE? I have a flat file and need to insert delimiters at fixed positions in all the lines so that I can easily convert into EXCEL with columns defined as per their width. For Example Here is the file { kkjhdhal sdfewss sdtereetyw... (7 Replies)
Discussion started by: jd_mca
7 Replies

4. Shell Programming and Scripting

Selecting Specific Columns and Insert the delimiter TAB

Hi, I am writing a Perl Script for the below : I have a data file that consists of the header information which is 231 Lines and the footer information as 4 lines. The total number of line including the header and footer 1.2 Million with Pipe Delimited file. For example: Header Information:... (4 Replies)
Discussion started by: filter
4 Replies

5. Shell Programming and Scripting

Shell script to put delimiter for a no delimiter variable length text file

Hi, I have a No Delimiter variable length text file with following schema - Column Name Data length Firstname 5 Lastname 5 age 3 phoneno1 10 phoneno2 10 phoneno3 10 sample data - ... (16 Replies)
Discussion started by: Gaurav Martha
16 Replies

6. Shell Programming and Scripting

Perl Code to change file delimiter (passed as argument) to bar delimiter

Hi, Extremely new to Perl scripting, but need a quick fix without using TEXT::CSV I need to read in a file, pass any delimiter as an argument, and convert it to bar delimited on the output. In addition, enclose fields within double quotes in case of any embedded delimiters. Any help would... (2 Replies)
Discussion started by: JPB1977
2 Replies

7. Shell Programming and Scripting

[Solved] Insert tabs as delimiter

Hello all, I have an unstructured file with space as delimiter , which I want to structure. The output file should actually have only 5 columns with tab as delimiter. The 4th column can have only 3 values ( biological_process , cellular_component , molecular_function ) Here is how the... (12 Replies)
Discussion started by: ritakadm
12 Replies

8. Shell Programming and Scripting

Insert a new column with sequence number (Delimiter as comma)

Hi All, I have a file which has data like a,b c,d e,f g,h And I need to insert a new column at the begining with sequence no( 1 to n) 1,a,b 2,c,d 3,e,f 4,g,h Please let me know how to acheive this in unix (3 Replies)
Discussion started by: weknowd
3 Replies

9. Shell Programming and Scripting

Linux shell script to insert new lines based on delimiter count

The input file is a .dat file which is delimited by null (^@ in Linux). On a windows PC it looks something like this (numbers are masked with 1). https://i.imgur.com/nta2Gqp.jpg The entire file is in one row but it has multiple records - each record contains 80 fields i.e. there are 81 counts... (9 Replies)
Discussion started by: digitalnirvana
9 Replies

10. Shell Programming and Scripting

Insert a value between two empty delimiter in the file.

Would like to insert value between two empty delimiter and at the very last too if empty. $ cat customerleft.tbl 300|Customer#000000300|I0fJfo60DRqQ|7|17-165-193-5964|8084.92|\N|p fluffily among the slyly express grouches. furiously express instruct||||||||||||||||||||||||\N... (3 Replies)
Discussion started by: Mannu2525
3 Replies
PROP_SEND_SYCALL(3)					   BSD Library Functions Manual 				       PROP_SEND_SYCALL(3)

NAME
prop_array_send_syscall, prop_array_recv_syscall, prop_dictionary_send_syscall, prop_dictionary_recv_syscall -- send and receive property lists to and from the kernel using syscalls SYNOPSIS
#include <prop/proplib.h> int prop_array_send_syscall(prop_array_t array, struct plistref *prefp); int prop_array_recv_syscall(const struct plistref *prefp, prop_array_t *arrayp); int prop_dictionary_send_syscall(prop_dictionary_t dict, struct plistref *prefp); int prop_dictionary_recv_syscall(const struct plistref *prefp, prop_dictionary_t *dictp); DESCRIPTION
The prop_array_send_syscall, prop_array_recv_syscall, prop_dictionary_send_syscall, and prop_dictionary_recv_syscall functions implement the user space side of a protocol for sending property lists to and from the kernel using syscall(2). RETURN VALUES
If successful, functions return zero. Otherwise, an error number is returned to indicate the error. EXAMPLES
The following (simplified) example demonstrates using prop_dictionary_send_syscall() and prop_dictionary_recv_syscall() in an application: void foo_setprops(prop_dictionary_t dict) { struct pref pref; (void) prop_dictionary_send_syscall(dict, &pref); (void) my_syscall_set(&pref); } prop_dictionary_t foo_getprops(void) { prop_dictionary_t dict; struct pref pref; (void) my_syscall_get(&pref); if (prop_dictionary_recv_syscall(&pref, &dict) != 0) return (NULL); return (dict); } ERRORS
prop_array_send_syscall() and prop_dictionary_send_syscall() will fail if: [ENOMEM] Cannot allocate memory [ENOTSUP] Not supported prop_array_recv_syscall() and prop_dictionary_recv_syscall() will fail if: [EIO] Input/output error [ENOTSUP] Not supported SEE ALSO
prop_array(3), prop_dictionary(3), proplib(3), prop_copyin_ioctl(9) HISTORY
The proplib property container object library first appeared in NetBSD 4.0. BSD
January 17, 2011 BSD
All times are GMT -4. The time now is 08:53 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy