मुख्य सामग्री पर जाएं

Excel डेटा (चयन या शीट) को Excel में टेक्स्ट फ़ाइलों में कैसे निर्यात करें?

लेखक: केली अंतिम संशोधित: 2020-05-08

यदि आपको किसी कार्यपुस्तिका को टेक्स्ट फ़ाइल के प्रारूप में वितरित करना आवश्यक है, तो आपको कार्यपुस्तिका को टेक्स्ट फ़ाइलों में परिवर्तित करना होगा। और यह आलेख आपको एक्सेल डेटा को टेक्स्ट फ़ाइलों में आसानी से निर्यात करने के दो तरीकों से परिचित कराएगा।

एक्सेल में टेक्स्ट फ़ाइल में एक सिंगल शीट निर्यात करें

डिफ़ॉल्ट रूप से, एक्सेल डेटा को कार्यपुस्तिकाओं के प्रारूप में सहेजा जाएगा . Xlsx. हालाँकि, हम मौजूदा वर्कबुक की वर्कशीट को टेक्स्ट फ़ाइलों के रूप में निर्यात कर सकते हैं इस रूप में सहेजें विशेषता। कृपया इस प्रकार करें:

1. उस वर्कशीट पर शिफ्ट करें जिसे आप टेक्स्ट फ़ाइल में निर्यात करेंगे, और क्लिक करें पट्टिका (या कार्यालय बटन)> इस रूप में सहेजें.

2. उद्घाटन में इस रूप में सहेजें संवाद बॉक्स, उस गंतव्य फ़ोल्डर का चयन करें जिसमें आप निर्यात की गई टेक्स्ट फ़ाइल को सहेजेंगे, फ़ाइल को नाम दें फ़ाइल नाम बॉक्स, और फिर चुनें यूनिकोड पाठ (*.txt) से प्रकार के रूप में सहेजें ड्रॉप डाउन सूची। स्क्रीनशॉट देखें:
इस रूप में सहेजें सुविधा के साथ टेक्स्ट फ़ाइल में निर्यात करें

3. फिर यह दो चेतावनी संवाद बॉक्स पॉप अप करेगा जो आपसे केवल सक्रिय वर्कशीट को टेक्स्ट फ़ाइल के रूप में निर्यात करने और टेक्स्ट फ़ाइल के साथ किसी भी असंगत सुविधाओं को छोड़ने के लिए कहेगा। क्लिक OK बटन और हाँ क्रमिक रूप से बटन.

फिर सक्रिय वर्कशीट में डेटा एक नई टेक्स्ट फ़ाइल के रूप में निर्यात किया जाता है।

नोट: इस रूप में सहेजें कमांड केवल सक्रिय वर्कशीट के डेटा को टेक्स्ट फ़ाइल के रूप में निर्यात करने में सक्षम है। यदि आप संपूर्ण कार्यपुस्तिका का सारा डेटा निर्यात करना चाहते हैं, तो आपको प्रत्येक कार्यपत्रक को व्यक्तिगत रूप से एक टेक्स्ट फ़ाइल के रूप में सहेजना होगा।


VBA के साथ टेक्स्ट फ़ाइल में चयन (या एक कॉलम) निर्यात करें

निम्नलिखित वीबीए कोड आपको चयनित श्रेणी डेटा (उदाहरण के लिए एक कॉलम) को टेक्स्ट फ़ाइल में निर्यात करने में भी मदद कर सकता है, कृपया ऐसा करें:

1. नीचे पकड़ो ALT + F11 कुंजियाँ, और यह खुल जाती है अनुप्रयोगों के लिए माइक्रोसॉफ्ट विज़ुअल बेसिक खिड़की.

2. क्लिक करें सम्मिलित करें > मॉड्यूल, और मॉड्यूल विंडो में निम्नलिखित कोड पेस्ट करें।

वीबीए: चयन या संपूर्ण वर्कशीट को टेक्स्ट फ़ाइल में निर्यात करें

Sub ExportRangetoFile()
'Update 20130913
Dim wb As Workbook
Dim saveFile As String
Dim WorkRng As Range
On Error Resume Next
xTitleId = "KutoolsforExcel"
Set WorkRng = Application.Selection
Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8)
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Set wb = Application.Workbooks.Add
WorkRng.Copy
wb.Worksheets(1).Paste
saveFile = Application.GetSaveAsFilename(fileFilter:="Text Files (*.txt), *.txt")
wb.SaveAs Filename:=saveFile, FileFormat:=xlText, CreateBackup:=False
wb.Close
Application.CutCopyMode = False
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub

3. फिर दबायें F5 इस कोड को चलाने की कुंजी. और फिर पॉप अप डायलॉग बॉक्स में उस डेटा रेंज का चयन करें जिसे आप निर्यात करना चाहते हैं, और क्लिक करें OK बटन, स्क्रीनशॉट देखें:
टेक्स्ट फ़ाइल के रूप में निर्यात करने के लिए एक कॉलम चुनें

4. और अब एक अन्य Save As डायलॉग बॉक्स में, कृपया इस टेक्स्ट फ़ाइल के लिए एक नाम और इस फ़ाइल को रखने के लिए एक फ़ोल्डर निर्दिष्ट करें, और क्लिक करें सहेजें बटन.


एक्सेल के लिए कुटूल के साथ टेक्स्ट फ़ाइल में चयन (या एक कॉलम) निर्यात करें

RSI इस रूप में सहेजें कमांड सक्रिय वर्कशीट में सभी डेटा को टेक्स्ट के रूप में निर्यात कर सकता है। यदि निर्दिष्ट निष्क्रिय वर्कशीट के सभी डेटा, या वर्कशीट में डेटा के कुछ हिस्से को टेक्स्ट फ़ाइल के रूप में निर्यात किया जाए तो क्या होगा? एक्सेल के लिए कुटूल's फ़ाइल में रेंज निर्यात करें उपयोगिता हमें टेक्स्ट फ़ाइल के रूप में चयन में डेटा को आसानी से निर्यात और सहेजने में मदद कर सकती है।  

एक्सेल के लिए कुटूल - एक्सेल के लिए 300 से अधिक आवश्यक उपकरणों से भरा हुआ। बिना किसी क्रेडिट कार्ड की आवश्यकता के पूर्ण-विशेषताओं वाले 30-दिवसीय निःशुल्क परीक्षण का आनंद लें! अभी डाउनलोड करो!

1. वह रंग चुनें जिसे आप टेक्स्ट फ़ाइल में निर्यात करेंगे (हमारे मामले में, हम कॉलम ए का चयन करते हैं), और क्लिक करें कुटूल्स प्लस > आयात निर्यात > फ़ाइल में रेंज निर्यात करें, स्क्रीनशॉट देखें:
एक्सेल ऐडिन: चयन को टेक्स्ट फ़ाइल में निर्यात करें

2. में फ़ाइल में रेंज निर्यात करें संवाद बॉक्स, नीचे दिखाए गए स्क्रीनशॉट के अनुसार करें:
एक्सेल ऐडिन: चयन को टेक्स्ट फ़ाइल में निर्यात करें
(1) जाँच करें यूनिकोड पाठ में विकल्प फ़ाइल प्रारूप अनुभाग;
(2) टेक्स्ट विकल्प अनुभाग में आवश्यकतानुसार वास्तविक मान सहेजें विकल्प या ऑन-स्क्रीन दिखाए गए मान सहेजें विकल्प की जांच करें;
(3) उस गंतव्य फ़ोल्डर को निर्दिष्ट करें जिसमें आप निर्यात की गई टेक्स्ट फ़ाइल को सहेजेंगे;
(4) क्लिक करें Ok बटन.

3. नए खुलने वाले डायलॉग बॉक्स में निर्यात की गई टेक्स्ट फ़ाइल को नाम दें और क्लिक करें Ok बटन.
निर्यातित टेक्स्ट फ़ाइल को नाम दें

और फिर चयन (चयनित कॉलम ए) को एक टेक्स्ट फ़ाइल के रूप में निर्यात किया गया है और निर्दिष्ट फ़ोल्डर में सहेजा गया है।

एक्सेल के लिए कुटूल - 300 से अधिक आवश्यक उपकरणों के साथ सुपरचार्ज एक्सेल। बिना किसी क्रेडिट कार्ड की आवश्यकता के पूर्ण-विशेषताओं वाले 30-दिवसीय निःशुल्क परीक्षण का आनंद लें! अब समझे


एक्सेल में टेक्स्ट फ़ाइलों को अलग करने के लिए एकाधिक शीट निर्यात करें

कभी-कभी आपको एक्सेल में एकाधिक वर्कशीट को एकाधिक टेक्स्ट फ़ाइलों में निर्यात करने की आवश्यकता हो सकती है। इस रूप में सहेजें सुविधा थोड़ी कठिन हो सकती है! चिंता न करें! एक्सेल के लिए कुटूल विभाजित कार्यपुस्तिका उपयोगिता एक्सेल उपयोगकर्ताओं को कई क्लिक के साथ कई वर्कशीट को कई अलग-अलग टेक्स्ट फ़ाइलों में निर्यात करने का आसान समाधान प्रदान करती है। 

एक्सेल के लिए कुटूल - एक्सेल के लिए 300 से अधिक आवश्यक उपकरणों से भरा हुआ। बिना किसी क्रेडिट कार्ड की आवश्यकता के पूर्ण-विशेषताओं वाले 30-दिवसीय निःशुल्क परीक्षण का आनंद लें! अभी डाउनलोड करो!

1। क्लिक करें कुटूल्स प्लस > कार्यपुस्तिकाविभाजित कार्यपुस्तिका. स्क्रीनशॉट देखें:
एक्सेल ऐडिन: टेक्स्ट फ़ाइलों में एकाधिक शीट निर्यात करें

2. आरंभिक स्प्लिट वर्कबुक संवाद बॉक्स में, कृपया निम्नानुसार कार्य करें:
एक्सेल ऐडिन: टेक्स्ट फ़ाइलों में एकाधिक शीट निर्यात करें
(1) उन कार्यपत्रकों की जांच करें जिन्हें आप अलग-अलग टेक्स्ट फ़ाइलों में निर्यात करेंगे कार्यपुस्तिका का नाम अनुभाग;
(2) जाँच करें सहेजें प्रारूप निर्दिष्ट करें विकल्प चुनें, और फिर चुनें यूनिकोड टेक्स्ट (*.txt) नीचे ड्रॉप डाउन सूची से, बाएँ स्क्रीनशॉट देखें:
(3) क्लिक करें विभाजित करें बटन.

3. और फिर पॉप अप ब्राउज फॉर फोल्डर डायलॉग बॉक्स में, उस गंतव्य फ़ोल्डर का चयन करें जिसमें आप निर्यात की गई टेक्स्ट फ़ाइलों को सहेजेंगे, और क्लिक करें OK बटन.

अब तक प्रत्येक निर्दिष्ट वर्कशीट को एक अलग टेक्स्ट फ़ाइल के रूप में निर्यात किया गया है और निर्दिष्ट फ़ोल्डर में सहेजा गया है।

एक्सेल के लिए कुटूल - 300 से अधिक आवश्यक उपकरणों के साथ सुपरचार्ज एक्सेल। बिना किसी क्रेडिट कार्ड की आवश्यकता के पूर्ण-विशेषताओं वाले 30-दिवसीय निःशुल्क परीक्षण का आनंद लें! अब समझे

एक्सेल में प्रत्येक शीट को एक अलग पीडीएफ/टेक्स्ट/सीएसवी फ़ाइल या वर्कबुक के रूप में आसानी से बड़े पैमाने पर सहेजें

आम तौर पर हम सक्रिय वर्कशीट को Save As फीचर के साथ एक अलग .pdf फ़ाइल, .txt फ़ाइल, या .csv फ़ाइल के रूप में सहेज सकते हैं। लेकिन एक्सेल के लिए कुटूल विभाजित कार्यपुस्तिका उपयोगिता आपको प्रत्येक कार्यपुस्तिका को एक्सेल में अलग पीडीएफ/टेक्स्ट/सीएसवी फ़ाइल या कार्यपुस्तिका के रूप में आसानी से सहेजने में मदद कर सकती है।


विज्ञापन विभाजित कार्यपुस्तिका पीडीएफ 1

एक्सेल के लिए कुटूल - 300 से अधिक आवश्यक उपकरणों के साथ सुपरचार्ज एक्सेल। बिना किसी क्रेडिट कार्ड की आवश्यकता के पूर्ण-विशेषताओं वाले 30-दिवसीय निःशुल्क परीक्षण का आनंद लें! अब समझे


डेमो: एक्सेल डेटा (चयन या शीट) को एक्सेल में टेक्स्ट फ़ाइलों में निर्यात करें


एक्सेल के लिए कुटूल: आपकी उंगलियों पर 300 से अधिक उपयोगी उपकरण! आज ही बिना किसी सुविधा सीमा के अपना 30-दिवसीय निःशुल्क परीक्षण प्रारंभ करें। अब डाउनलोड करें!

संबंधित आलेख:

सर्वोत्तम कार्यालय उत्पादकता उपकरण

🤖 कुटूल्स एआई सहयोगी: निम्न के आधार पर डेटा विश्लेषण में क्रांति लाएं: बुद्धिमान निष्पादन   |  कोड जनरेट करें  |  कस्टम फ़ॉर्मूले बनाएं  |  डेटा का विश्लेषण करें और चार्ट बनाएं  |  कुटूल फ़ंक्शंस का आह्वान करें...
लोकप्रिय सुविधाएँ: डुप्लिकेट ढूंढें, हाइलाइट करें या पहचानें   |  रिक्त पंक्तियाँ हटाएँ   |  डेटा खोए बिना कॉलम या सेल को संयोजित करें   |   फॉर्मूला के बिना गोल ...
सुपर लुकअप: एकाधिक मानदंड VLookup    मल्टीपल वैल्यू वीलुकअप  |   अनेक शीटों में VLookup   |   फजी लुकअप ....
उन्नत ड्रॉप-डाउन सूची: शीघ्रता से ड्रॉप डाउन सूची बनाएं   |  आश्रित ड्रॉप डाउन सूची   |  बहु-चयन ड्रॉप डाउन सूची ....
स्तम्भ प्रबंधक: कॉलमों की एक विशिष्ट संख्या जोड़ें  |  कॉलम ले जाएँ  |  छिपे हुए कॉलम की दृश्यता स्थिति टॉगल करें  |  रेंज और कॉलम की तुलना करें ...
फीचर्ड फीचर्स: ग्रिड फोकस   |  डिजाइन देखें   |   बड़ा फॉर्मूला बार    कार्यपुस्तिका एवं शीट प्रबंधक   |  संसाधन लाइब्रेरी (ऑटो टेक्स्ट)   |  खजूर बीनने वाला   |  कार्यपत्रकों को संयोजित करें   |  एन्क्रिप्ट/डिक्रिप्ट सेल    सूची के अनुसार ईमेल भेजें   |  सुपर फ़िल्टर   |   विशेष फ़िल्टर (फ़िल्टर बोल्ड/इटैलिक/स्ट्राइकथ्रू...) ...
शीर्ष 15 टूलसेट12 टेक्स्ट टूल्स (पाठ जोड़ें, अक्षर हटाएँ, ...)   |   50 + चार्ट प्रकार (गैन्ट चार्ट, ...)   |   40+ प्रैक्टिकल सूत्र (जन्मदिन के आधार पर आयु की गणना करें, ...)   |   19 निवेशन टूल्स (QR कोड डालें, पथ से चित्र सम्मिलित करें, ...)   |   12 रूपांतरण टूल्स (शब्दों को संख्याएँ, मुद्रा रूपांतरण, ...)   |   7 विलय और विभाजन टूल्स (उन्नत संयोजन पंक्तियाँ, विभाजन कोशिकाओं, ...)   |   ... और अधिक

एक्सेल के लिए कुटूल के साथ अपने एक्सेल कौशल को सुपरचार्ज करें, और पहले जैसी दक्षता का अनुभव करें। एक्सेल के लिए कुटूल उत्पादकता बढ़ाने और समय बचाने के लिए 300 से अधिक उन्नत सुविधाएँ प्रदान करता है।  वह सुविधा प्राप्त करने के लिए यहां क्लिक करें जिसकी आपको सबसे अधिक आवश्यकता है...

Description


ऑफिस टैब ऑफिस में टैब्ड इंटरफ़ेस लाता है, और आपके काम को बहुत आसान बनाता है

  • Word, Excel, PowerPoint में टैब्ड संपादन और रीडिंग सक्षम करें, प्रकाशक, एक्सेस, विसियो और प्रोजेक्ट।
  • नई विंडो के बजाय एक ही विंडो के नए टैब में एकाधिक दस्तावेज़ खोलें और बनाएं।
  • आपकी उत्पादकता 50% बढ़ जाती है, और आपके लिए हर दिन सैकड़ों माउस क्लिक कम हो जाते हैं!
Comments (19)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
How would I amend the code for Export selection (or one column) to text file with VBA to autofill the filename with the contents of cell B2?
thanks
This comment was minimized by the moderator on the site
Hi,This is great, thanks a lot.
How would I alter the code for Export selection (or one column) to text file with VBA to auto fill the filename with the contents of cell B2?
This comment was minimized by the moderator on the site
Hi, this code is very useful for me. So thank you very much.
I want to ask that: When i'm using this code, a new line append automatically at the end of the txt content.
Can you help me about preventing this by vba?
This comment was minimized by the moderator on the site
hi guys, i used that code:
Sub ExportRangetoFile()
'Update 20130913
Dim wb As Workbook
Dim saveFile As String
Dim WorkRng As Range
On Error Resume Next
xTitleId = "KutoolsforExcel"
Set WorkRng = Application.Selection
Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8)
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Set wb = Application.Workbooks.Add
WorkRng.Copy
wb.Worksheets(1).Paste
saveFile = Application.GetSaveAsFilename(fileFilter:="Text Files (*.txt), *.txt")
wb.SaveAs Filename:=saveFile, FileFormat:=xlText, CreateBackup:=False
wb.Close
Application.CutCopyMode = False
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub

and have working, but i need to savea column with cells that contain the function"concatenate", and when i play the vba code, and i save the .TXT file, only what appears it's #REF. how can i to fix it? cause i need the data that appears on that cells?
This comment was minimized by the moderator on the site
Has anyone been able to figure this out? I am having the same issue.
This comment was minimized by the moderator on the site
HELLO
THANK YOU FOR YOUR VBA CODE
SOMETIMES ON CERTAIN TEXT THERE IS "TEXT" IN EXPORT .TXT
THANK YOU FOR WHY
This comment was minimized by the moderator on the site
Thanks for the awesome piece of VBA code to export data to a text file. I have used your code with some of my own. The data I am dealing with is extremely line-length specific and after the macro has run, the text file contains some double quotation marks " at random places, which was never present in my data before. I have tried adding a code line to remove this character at various stages but that does not seem to be working. I am aware that I can manually remove this but would like to resolve it in the VBA code.

Sub Macro3()
Dim wb As Workbook
Dim saveFile As String
Dim WorkRng As Range
On Error Resume Next
Selection.AutoFilter
ActiveSheet.Range("$A$1:$B$10591").AutoFilter Field:=1, Criteria1:= _
"=NSZAP*", Operator:=xlAnd
Range("A1").Select
ActiveCell.Offset(200, 0).Range("A1").Select
Range(Selection, Selection.End(xlDown)).Select
ActiveCell.Rows("1:10101").EntireRow.Select
Selection.Delete Shift:=xlUp
Range("A1").Select
Selection.AutoFilter
Range(Selection, Selection.End(xlDown)).Select
Set WorkRng = Application.Selection
Set wb = Application.Workbooks.Add
WorkRng.Copy
wb.Worksheets(1).Paste
Selection.Replace What:="""", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
saveFile = Application.GetSaveAsFilename(fileFilter:="Text Files (*.txt), *.txt")
Selection.Replace What:="""", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
wb.SaveAs Filename:=saveFile, FileFormat:=xlText, CreateBackup:=False
Selection.Replace What:="""", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
wb.Close
Application.CutCopyMode = False
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub
This comment was minimized by the moderator on the site
Hi Harish,
For removing a specified character in bulk, you can replace the character with nothing.
Ctrl + H to open the Find and Replace dialog box, type the specified character in the Find what box, and type noting in the replace with box.
This comment was minimized by the moderator on the site
3/2 You might also note that you don't need to specify the wb prefix once you've .Add ed the workbook since it becomes active. Specifying wb might or might not be more efficient but it can be omitted from some commands. Actually I entirely scrapped the variable wb; I just go Workbooks.Add, and use ActiveWorkbook when needed. (As you are suppressing ScreenUpdating it wouldn't be obvious to some that wb is Active. Tip for beginners (and higher): I always, always develop with ScreenUpdating and DisplayAlerts as True, and when done with development, I consider toggling them off for some passage of code.)
This comment was minimized by the moderator on the site
2/2 - vbYesNoCancel msgboxes and Booleans to indicate whether to export all, selection, or a user specified range - a static String for the prior range address - if len(that static)1 then I set WorkRng=activesheet.UsedRange (You can't copy multiple areas with a single copy, though with a little work you could walk the areas and copy them piecemeal.) - Idiotic Microsoft does not save off empty rows at the start and the bottom of the saved range, and does not save off empty columns at the leftmost and the rightmost of the saved range. When I detect that (UsedRange is not row 1, col. 1, or xlLastCell is not completely lower-right) I msgbox to ask user if they want to plug A1 or the lower right cell. - Then I decided to preemptively address the upper left issue by inserting a row and setting A1 to be text like "The following is for range " - I close with activeworkbook.close SaveChanges:=False - Long time habit since I'm an angry proponent of cleaning up (and the world is a sad place thanks to irresponsible programmers who shirk that responsibility when it matters), I set WorkRng = Nothing on the way out :)
This comment was minimized by the moderator on the site
1/2 (since your software limits comment length) I am a serious coder and I want to inform you that the VBA code here is outstanding. It's clean, and not one line too much, or one too few. It's exemplary coding for demonstration of the process. I'll also mention that as I extensively researched solutions for export of selection, you and only one other person suggested dropping the range into a temp new workbook. All other answers were painfully manually, walking through cell by cell. Even Chip's code is much longer and runs slower (but intentionally so, as it is much more flexible - specifiable delimiters, etc.) Just for your amusement, I made some very minor tweaks but otherwise nearly lifted the code word for word because it basically dropped right into a very intricate and specialized application. Some of these tweaks are something I'm sure you do in practice, but they add lines of code (e.g. error checking) so showing them on this webpage would have muddied your display so that the essential elements of processing would have been cumbersome for readers to follow along. Anyway: (see part 2)
This comment was minimized by the moderator on the site
My query is as mentioned below: I have a report to generate everyday. The data what I get on the final row (only one row but more than one columns) I want it to export to another excel sheet which is a summary excel sheet saved separately on my desktop. Eg: Day1 report - final row export to Summary excel sheet row1 Day2 report - final row export to Summary excel sheet row2 Day3 report - final row export to Summary excel sheet row3 and so on.. Export should be done through a click button., which means when I click on export button the data on the sheet I calculated today should go and save on the Summary excel sheet row1, next day a new excel sheet report calculated should go and save on the Summary excel sheet row2 and so on.. Will this be possible to do... If yes please someone help me on this... Thank you in advance...:-)
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations