Sponsored Content
Full Discussion: Formatting a string
Top Forums Shell Programming and Scripting Formatting a string Post 302472694 by Chubler_XL on Wednesday 17th of November 2010 09:13:35 PM
Old 11-17-2010
OP also wanted to translate from YMD to DMY format
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

formatting

Hi Again Guys , Please i installed linux RH 6.1 on Toshiba , 10G , RAM=128 , 600 MHZ . After i installed linux i got many error messages , seems it was not installed correctly , also when i finished installation it did not ask me for the 2nd installation CD , and when i logged as root , i... (5 Replies)
Discussion started by: tamemi
5 Replies

2. Shell Programming and Scripting

awk printf formatting using string format specifier.

Hi all, My simple AWK code does C = A - B If C can be a negative number, how awk printf formating handles it using string format specifier. Thanks in advance Kanu :confused: (9 Replies)
Discussion started by: kanu_pathak
9 Replies

3. Shell Programming and Scripting

SH string formatting

Hi all, my syslog.txt is a file like this: Jan 20 10:55:19 cerbero | process1: process1.--: |Info |xyxyxyxyxyxyxx | Jan 20 10:59:45 cerbero | processlong2 : threadlong1.0 : |Info |ughxueeughxueeuxexuexueuxexuexue | I need a .sh script to print to screen something like this. Jan... (3 Replies)
Discussion started by: ric79
3 Replies

4. Shell Programming and Scripting

Help formatting a string. Something like printf?

Hi I'm having a problem with converting a file: ID X 1 7 1 8 1 3 2 5 2 7 2 2 To something like this: ID X1 X2 X3 1 7 8 3 2 5 7 2 I've tried the following loop: for i in `cat tst.csv| awk -F "," '{print $1}'| uniq`;do grep -h $i... (4 Replies)
Discussion started by: flotsam
4 Replies

5. Shell Programming and Scripting

String formatting using AWK

Hi, I need to insert a line at a particular line number. I am using the below code: sed $REV_LINO_NO" i\\ # $CURRENT_DATE $NAME Changed pwd for cindy\'s id" file > file1 This code works, but the formatting is not as I expected. For example, I get lines as shown below... (2 Replies)
Discussion started by: sugan
2 Replies

6. Shell Programming and Scripting

String formatting using awk printf

Hi Friends, I am trying to insert lines of the below format in a file: # x3a4914 Joe 2010/04/07 # seh Lane 2010/04/07 # IN01379 Larry 2010/04/07 I am formatting the strings as follows using awk printf: awk 'printf "# %s %9s %18s\n", $2,$3,$4}' ... (2 Replies)
Discussion started by: sugan
2 Replies

7. UNIX for Dummies Questions & Answers

string formatting

how can I format this so the output looks like so: 811420 -rwx------ 1 cw33221 student 8952 Jan 26 2011 a.out I keep getting this 811420 -rwx------ 1 cw33221 student 8952 Jan 26 17:31 a.out Here's the code I want to minuplate: printf( "%d\t" , info_p->st_ino); (4 Replies)
Discussion started by: l flipboi l
4 Replies

8. Shell Programming and Scripting

help formatting

I need to format a txt file and convert it in CSV. Any "future" column is separated by a newline. FROM: XS1 1.43294 0.0 XS2 1.21824 0.0 TO: XS1,XS2 (2 Replies)
Discussion started by: alfreale
2 Replies

9. Shell Programming and Scripting

to extract string from main string and string comparison

continuing from my previous post, whose link is given below as a reference https://www.unix.com/shell-programming-scripting/171076-shell-scripting.html#post302573569 consider there is create table commands in a file for eg: CREATE TABLE `Blahblahblah` ( `id` int(11) NOT NULL... (2 Replies)
Discussion started by: vivek d r
2 Replies

10. Shell Programming and Scripting

sed or awk command to replace a string pattern with another string based on position of this string

here is what i want to achieve... consider a file contains below contents. the file size is large about 60mb cat dump.sql INSERT INTO `table1` (`id`, `action`, `date`, `descrip`, `lastModified`) VALUES (1,'Change','2011-05-05 00:00:00','Account Updated','2012-02-10... (10 Replies)
Discussion started by: vivek d r
10 Replies
smd-translate(1)					 Sync Mail Dir (smd) documentation					  smd-translate(1)

NAME
smd-translate - translates mailbox names according to predefined patterns SYNOPSIS
smd-translate [-m mode] [-d direction] endpoint mailbox DESCRIPTION
smd-translate translates mailbox names according to predefined patterns. It is designed to be used in the configuration file of smd- push(1) and smd-pull(1). Refer to smd-config(5) for a longer discussion on translators. Supported modes follow. oimap-dovecot This mode is designed to make the transition of offlineimap users to smd simpler. It assumes remote mailboxes are named like in the follow- ing: Maildir/cur Maildir/.sub.folder/new The corresponding local mailboxes are named like in the following: Mail/cur Mail/sub.folder/new nodots This mode simply gets rid of all dots. It assumes remote mailboxes are named like in the following: Maildir/cur Maildir/.sub.folder/new The corresponding local mailboxes are named like in the following: Mail/cur Mail/sub/folder/new move This mode just replaces the root of the mailbox, i.e. substitutes MAILBOX_LOCAL for MAILBOX_REMOTE and viceversa. USAGE IN CONFIGURATION FILE
Assuming the MAILBOX_LOCAL configuration variable is set to Mail and the MAILBOX_REMOTE is set to Maildir, one can use the following con- figuration file snippet in ~/.smd/config.endpoint: TRANSLATOR_RL="smd-translate -m oimap-dovecot -d RL endpoint" TRANSLATOR_LR="smd-translate -m oimap-dovecot -d LR endpoint" To test your setup use the smd-check-conf(1) utility. OPTIONS
-m mode One of the supported modes listed above -d direction One of RL or LR endpoint Is the suffix for the name of the configuration file to use mailbox The mailbox name to translate FILES
~/.smd/config.* SEE ALSO
smd-push(1), smd-pull(1), smd-config(5), smd-check-conf(1) AUTHOR
Enrico Tassi <gares@fettunta.org> 11 June 2012 smd-translate(1)
All times are GMT -4. The time now is 05:36 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy