troubleshooting Question

Truncate Text in Text File

Avatar of tracyms
tracyms asked on
ProgrammingWindows BatchWindows Server 2008
7 Comments1 Solution34 ViewsLast Modified:
I'm looking for a way to truncate text to 18 characters (if it's not already 18 characters) before it's copied to a folder. The text structure will always  be the same and I need to truncate the lines between the 2nd and 3rd caret:

12345^2020-2021^This is the line I need to have truncated to 18 characters^05152020
67891^2019-2020^This is the line I need to have truncated to 18 characters^05152020

I already have a batch to copy the file but wondering if I can use a batch to truncate it first, then copy it? The file is on a Windows server. Thanks!

Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 7 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros