For Programmers: Free Programming Magazines  


Home > Archive > AWK > February 2005 > modify string in file: L"foo" -> TEXT("foo")









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author modify string in file: L"foo" -> TEXT("foo")
Alexander Grau

2005-02-16, 8:56 am

Hello-

I try to reply all occurrences of

L"foo"

by

TEXT("foo")

in a file where foo can be any text. This is what I thought should work:

#!/bin/bash
awk '{ gsub(/L"[^",]*"/, "TEXT(" substr("&",2) ")" ); print }' testfile.txt

but it doesn't (it just shows TEXT() without the "foo")...
What could be wrong here?

Thanks!
Alex


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com