delete 2 columns from text file using find and replace or other me

L

Larry

have a tex file fixed length record trying to import into sql server won't
date convert a mmddyyyy need to delete the 2 columns in the text file opened
in word by using find and replace or some other method.....anyone know how to
group delete on 2 specified columns? Need to remove the first 2 bytes of the
year
 
C

CyberTaz

Two options that don't require any fancy syntax or VBA:

Hold the Alt key while you drag to select jsut the first two digits of the
years, then press Delete, or

Hold the Alt key while you drag to select the column of year data then run
F/R to locate 19, replace with nothing. If there are any likely occurences
of 1919, of course, you don't want to use Replace All :) Just be sure to
say "NO" when asked if you want to start from the beginning. If necessary
repeat for years beginning with 20.
 
L

Larry

only problem is this text file has almost 10,000 records....is there a way to
identify specific columns to delete. I am well aware of how to use the find
and replace and all it's options but thought maybe something else was
available to perform what I need done....i either find a way to edit this
text file or rerun a mainframe extract pgm that takes 4 hrs to finish.

Any other ideas come to light?
 
G

Graham Mayor

Use a wildcard search for
([0-9]{4})[0-9]{2}([0-9]{2})
replace with \1\2

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
L

Larry

Wildcard search would still change any other data with 19 or 20 in the text
right.

How would you use it?
--
Larry


Graham Mayor said:
Use a wildcard search for
([0-9]{4})[0-9]{2}([0-9]{2})
replace with \1\2

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

have a tex file fixed length record trying to import into sql server
won't date convert a mmddyyyy need to delete the 2 columns in the
text file opened in word by using find and replace or some other
method.....anyone know how to group delete on 2 specified columns?
Need to remove the first 2 bytes of the year
 
G

Graham Mayor

The wildcard search in question would only affect 8 digit numbers, which
would be your dates.
You could limit it further with
([0-9]{4})[0129]{2}([0-9]{2})
How would you use it?
Open the document
CTRL+H
in the find box copy and paste
([0-9]{4})[0129]{2}([0-9]{2})
in the replace box type
\1\2
Check 'More'
Check the wildcard box
Replace all

If you have other 8 digit numbers that are not dates, send me a sample of
the data (a few records only) to the link on the home page of my web site.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Wildcard search would still change any other data with 19 or 20 in
the text right.

How would you use it?
Use a wildcard search for
([0-9]{4})[0-9]{2}([0-9]{2})
replace with \1\2

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

have a tex file fixed length record trying to import into sql server
won't date convert a mmddyyyy need to delete the 2 columns in the
text file opened in word by using find and replace or some other
method.....anyone know how to group delete on 2 specified columns?
Need to remove the first 2 bytes of the year
 
L

Larry

Works like a charm....you ARE the MAN.... saved me from re-running a 4 hr
extract job. Many Thanks
--
Larry


Graham Mayor said:
The wildcard search in question would only affect 8 digit numbers, which
would be your dates.
You could limit it further with
([0-9]{4})[0129]{2}([0-9]{2})
How would you use it?
Open the document
CTRL+H
in the find box copy and paste
([0-9]{4})[0129]{2}([0-9]{2})
in the replace box type
\1\2
Check 'More'
Check the wildcard box
Replace all

If you have other 8 digit numbers that are not dates, send me a sample of
the data (a few records only) to the link on the home page of my web site.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Wildcard search would still change any other data with 19 or 20 in
the text right.

How would you use it?
Use a wildcard search for
([0-9]{4})[0-9]{2}([0-9]{2})
replace with \1\2

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>


Larry wrote:
have a tex file fixed length record trying to import into sql server
won't date convert a mmddyyyy need to delete the 2 columns in the
text file opened in word by using find and replace or some other
method.....anyone know how to group delete on 2 specified columns?
Need to remove the first 2 bytes of the year
 
G

Graham Mayor

You are welcome :)

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

Works like a charm....you ARE the MAN.... saved me from re-running a
4 hr extract job. Many Thanks
The wildcard search in question would only affect 8 digit numbers,
which would be your dates.
You could limit it further with
([0-9]{4})[0129]{2}([0-9]{2})
How would you use it?
Open the document
CTRL+H
in the find box copy and paste
([0-9]{4})[0129]{2}([0-9]{2})
in the replace box type
\1\2
Check 'More'
Check the wildcard box
Replace all

If you have other 8 digit numbers that are not dates, send me a
sample of the data (a few records only) to the link on the home page
of my web site.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Wildcard search would still change any other data with 19 or 20 in
the text right.

How would you use it?

Use a wildcard search for
([0-9]{4})[0-9]{2}([0-9]{2})
replace with \1\2

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>


Larry wrote:
have a tex file fixed length record trying to import into sql
server won't date convert a mmddyyyy need to delete the 2 columns
in the text file opened in word by using find and replace or some
other method.....anyone know how to group delete on 2 specified
columns? Need to remove the first 2 bytes of the year
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top