© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
23 replies
Surihia

✅ Getting a string from a text file and get the whole line containing the string

I am making a app where I want to get the filename of a video file and then check if the filename exists in a text file. if it exists, then I want to get the line containing that string and I have few problems with this.

The video filename is "VIDEO_PRODUCT_AD01_AVI.mp4"
This very filename is stored in the text file as this string: "video_product_AD01_avi.mp4"

This filename is usually stored along with the file path in this way along with a lot of video filenames in this text file.
20797607 ..\Video\Products\video_product_AD01_avi.mp4 
20797607 ..\Video\Products\video_product_AD01_avi.mp4 

Now I know how to get the filename as a string from the video file but then matching that filename with the respective filename string in the text file, is where I am facing problems. I don't want to change the video filename or the filename string in the text file. is there any solution to this ?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

✅ Getting a string value from a set of strings stored in a text file
C#CC# / help
4y ago
❔ Help adding text to the end of a line in a text file
C#CC# / help
3y ago